
public class Queue_implArray implements Queue {
	private final int max = 10;
	private int head = 0;
	private int tail = 0;
	private int zaehler;
	private Element[] liste = new Element[max];
	
	@Override
	public boolean enq(Element obj) {
		if(zaehler < max) {
			liste[tail] = obj;
			tail++;
			zaehler++;
			return true;
		}
		return false;
	}

	@Override
	public Element deq() {
		if(!empty()) {
			Element el = liste[head];
			head++;
			return el;
		}
		return null;
	}

	@Override
	public boolean empty() {
		if(head == tail && zaehler == 0)
			return true;
		return false;
	}

}
